import React, { Component } from 'react';
import Footer from "../../components/footer"
import { Form, Row, Col, Button } from "antd"
import { hot } from 'react-hot-loader'
import "./style.css"
import axios from "axios";

const url = "/api/otn/leftTicket/query?leftTicketDTO.train_date=2018-10-27&leftTicketDTO.from_station=GZQ&leftTicketDTO.to_station=TJP&purpose_codes=ADULT"
  //  const url = "/api/abc/a/b"
class view extends Component {
  constructor(props) {
    super(props)
    this.state = {
      num: 0
    }
  }
  componentDidMount() {
    this.loaderData()
  }
  loaderData() {
    this.setState({num: this.state.num + 1})
     axios.get(url).then(({data}) => {
       console.log(data);
     })
  }
  render() {
    return (
      <div>
        <Row>
          <Col>{this.state.num}<Button type="primary" onClick={() => this.loaderData()}>3查找</Button></Col>
        </Row>
        <Footer />
      </div>
    )
  }
}

export default hot(module)(Form.create()(view));
